var AppInfoManager = require("./AppInfoManager");
var FileProcessList = require("../dataProcess/FileProcessList");

var LogItemManger = {
    processNewLog : function(appId, appKey, logFilePath){
        return new Promise(function(resolve, reject){
            AppInfoManager.getAppInfoByAppId(appId).then(function(appInfo){
                    if(appInfo.appKey == appKey){
                        FileProcessList.getFileProcessList(appName, appInfo.logSchemaName).addFileToQueue(logFilePath);
                        resolve();
                    }else{
                        reject();
                    }
            }, reject);
        });
    }
}

module.exports = LogItemManger;
